package com.test.springboot_test.test05_ConfigurationTest;


import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

@Service
    public class MyService {

        private final MyAppProperties myAppProperties;

        public MyService(MyAppProperties myAppProperties) {
            this.myAppProperties = myAppProperties;
        }

        public void printConfig() {
            System.out.println("Name: " + myAppProperties.getName());
            System.out.println("Version: " + myAppProperties.getVersion());
            System.out.println("Features Enabled: " + myAppProperties.getFeatures().isEnabled());
            System.out.println("Retry Limit: " + myAppProperties.getFeatures().getRetryLimit());
        }

       /*@RequestMapping("/test005")
       public void test() {
            MyService myService = new MyService(new MyAppProperties());
            myService.printConfig();
        }*/

}
